package com.zookeeper.web.controller;

import com.zookeeper.base.core.dto.index.UserVo;
import com.zookeeper.web.handler.IndexHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Description
 * @Author zhaobaolin
 * @Date 2018/10/28
 */
@Controller
public class IndexController {

    @Autowired
    private IndexHandler indexHandler;

    @RequestMapping("/index")
    @ResponseBody
    public ResponseEntity<UserVo> index()
    {
        UserVo userVo = indexHandler.index();
        return new ResponseEntity<>(userVo, HttpStatus.OK);
    }
}
